From 15dbbfb12aaf075f53ac20edba6f9b79edde6b65 Mon Sep 17 00:00:00 2001 From: oliskoli Date: Tue, 19 Aug 2008 22:34:25 +0000 Subject: [PATCH] Add Humminbird route support. --- humminbird.c | 387 +++++++--- reference/humminbird.hwr | Bin 0 -> 864 bytes reference/humminbird~hwr.csv | 25 + reference/route/humminbird.hwr | Bin 0 -> 3504 bytes reference/route/humminbird~hwr.gpx | 1106 ++++++++++++++++++++++++++++ testo | 10 + vecs.c | 2 +- xmldoc/formats/humminbird.xml | 8 +- 8 files changed, 1446 insertions(+), 92 deletions(-) create mode 100644 reference/humminbird.hwr create mode 100644 reference/humminbird~hwr.csv create mode 100644 reference/route/humminbird.hwr create mode 100644 reference/route/humminbird~hwr.gpx diff --git a/humminbird.c b/humminbird.c index cdb716f5e..8fc823325 100644 --- a/humminbird.c +++ b/humminbird.c @@ -19,37 +19,57 @@ */ -#include "defs.h" #include +#include +#include +#include "defs.h" +#include "avltree.h" #define MYNAME "humminbird" -#define EAST_SCALE 20038297.0 /* this is i1924_equ_axis*M_PI */ -#define i1924_equ_axis 6378388.0 -#define i1924_polar_axis 6356911.946 +#define WPT_NAME_LEN 12 +#define RTE_NAME_LEN 20 +#define MAX_RTE_POINTS 50 -static -arglist_t humminbird_args[] = { -// {"foo", &fooopt, "The text of the foo option in help", -// "default", ARGYTPE_STRING, ARG_NOMINMAX}, - ARG_TERMINATOR -}; +#define WPT_MAGIC 0x02020024L +#define RTE_MAGIC 0x03030088L + +#define EAST_SCALE 20038297.0 /* this is i1924_equ_axis*M_PI */ +#define i1924_equ_axis 6378388.0 +#define i1924_polar_axis 6356911.946 + +#define BAD_CHARS "\r\n\t" /* The hwr data format is records-based, and the records are 36 bytes long. */ typedef struct humminbird_waypt_s { - gbuint32 signature; /* Just for error checking(?) */ - gbuint16 num; /* Always ascending in the file. */ - gbuint16 zero; /* Always seems to be zero. */ - gbuint8 status; /* Always seems to be 1 */ - gbuint8 icon; /* See below */ - gbuint16 depth; /* Water depth. These are fishfinders. In centimeters */ - gbuint32 time; /* This is a time_t. In UTC */ - gbint32 east; - gbint32 north; - char name[12]; + /* O.K.: the file can also contain routes with a different magic. */ + /* gbuint32 signature; */ /* Just for error checking(?) */ + gbuint16 num; /* Always ascending in the file. */ + gbuint16 zero; /* Always seems to be zero. */ + gbuint8 status; /* Always seems to be 1 */ + gbuint8 icon; /* See below */ + gbuint16 depth; /* Water depth. These are fishfinders. In centimeters */ + gbuint32 time; /* This is a time_t. In UTC */ + gbint32 east; + gbint32 north; + char name[WPT_NAME_LEN]; } humminbird_waypt_t; +typedef struct humminbird_rte_s { + /* O.K.: the file can contain also routes with a different magic. */ + /* gbuint32 signature; */ /* Just for error checking(?) */ + gbuint16 num; + gbuint16 zero; + gbuint8 status; + gbuint8 U0; + gbuint8 U1; + gbint8 count; + gbuint32 time; + char name[RTE_NAME_LEN]; + gbuint16 points[MAX_RTE_POINTS]; +} humminbird_rte_t; + static const char* humminbird_icons[] = { "Normal", /* 0 */ "House", /* 1 */ @@ -85,7 +105,16 @@ static const char* humminbird_icons[] = { static gbfile* fin; static gbfile* fout; -static int waypoint_num = 0; +static int waypoint_num; +static short_handle wptname_sh, rtename_sh; +static avltree_t *waypoints; +static humminbird_rte_t *humrte; +static int rte_num; + +static +arglist_t humminbird_args[] = { + ARG_TERMINATOR +}; /* Takes a latitude in degrees, * returns a latitude in degrees. */ @@ -93,7 +122,6 @@ static double geodetic_to_geocentric_hwr(const double gd_lat) { const double cos_ae = 0.9966349016452; const double cos2_ae = cos_ae * cos_ae; - const double gdr = gd_lat *M_PI / 180.0; return atan(cos2_ae * tan(gdr)) * 180.0/M_PI; @@ -104,9 +132,7 @@ geodetic_to_geocentric_hwr(const double gd_lat) { static double geocentric_to_geodetic_hwr(const double gc_lat) { const double cos_ae = 0.9966349016452; - const double cos2_ae = cos_ae * cos_ae; - const double gcr = gc_lat *M_PI / 180.0; return atan( tan(gcr)/cos2_ae ) * 180.0/M_PI; @@ -136,12 +162,14 @@ inverse_gudermannian_i1924(const double x) { static void humminbird_rd_init(const char *fname) { - fin = gbfopen(fname, "r", MYNAME); + fin = gbfopen_be(fname, "rb", MYNAME); + waypoints = avltree_init(0, MYNAME); } static void humminbird_rd_deinit(void) { + avltree_done(waypoints); gbfclose(fin); } @@ -149,63 +177,132 @@ static void humminbird_read(void) { while(! gbfeof(fin)) { - humminbird_waypt_t w; - double guder; - int bytes, num_icons; - waypoint *wpt; - - bytes = gbfread(&w, 1, sizeof(humminbird_waypt_t), fin); - if(bytes == 0) break; - - is_fatal((bytes != sizeof(humminbird_waypt_t)), - MYNAME ": Unexpected end of file (%d)!", - (int) sizeof(humminbird_waypt_t) - bytes); - - /* Fix endianness - these are now BE */ - w.signature = be_read32(&w.signature); - w.num = be_read16(&w.num); - w.zero = be_read16(&w.zero); - w.depth = be_read16(&w.depth); - w.time = be_read32(&w.time); - w.north = be_read32(&w.north); - w.east = be_read32(&w.east); - - is_fatal(( w.signature != 0x02020024L ), - MYNAME ": Invalid record header (no or unknown humminbird file)!"); - - /* All right! Copy the data to the gpsbabel struct... */ + gbuint32 signature; + + signature = gbfgetuint32(fin); - wpt = waypt_new(); + if (signature == WPT_MAGIC) { /* a waypoint */ + humminbird_waypt_t w; + double guder; + int num_icons; + waypoint *wpt; + char buff[10]; + + if (! gbfread(&w, 1, sizeof(w), fin)) + fatal(MYNAME ": Unexpected end of file!\n"); + + /* Fix endianness - these are now BE */ + w.num = be_read16(&w.num); + w.zero = be_read16(&w.zero); + w.depth = be_read16(&w.depth); + w.time = be_read32(&w.time); + w.north = be_read32(&w.north); + w.east = be_read32(&w.east); - wpt->shortname = xstrndup(w.name, sizeof(w.name)); - wpt->creation_time = w.time; + /* All right! Copy the data to the gpsbabel struct... */ - guder = gudermannian_i1924(w.north); - wpt->latitude = geocentric_to_geodetic_hwr(guder); - wpt->longitude = (double)w.east / EAST_SCALE * 180.0; + wpt = waypt_new(); - wpt->altitude = 0.0; /* It's from a fishfinder... */ + wpt->shortname = xstrndup(w.name, sizeof(w.name)); + wpt->creation_time = w.time; + + guder = gudermannian_i1924(w.north); + wpt->latitude = geocentric_to_geodetic_hwr(guder); + wpt->longitude = (double)w.east / EAST_SCALE * 180.0; + + wpt->altitude = 0.0; /* It's from a fishfinder... */ - if(w.depth != 0) - WAYPT_SET(wpt,depth,(double)w.depth / 100.0); + if (w.depth != 0) + WAYPT_SET(wpt,depth,(double)w.depth / 100.0); + + num_icons = sizeof(humminbird_icons) / sizeof(humminbird_icons[0]); + if (w.icon < num_icons) + wpt->icon_descr = humminbird_icons[w.icon]; - num_icons = sizeof(humminbird_icons) / sizeof(humminbird_icons[0]); - if(w.icon < num_icons) - wpt->icon_descr = humminbird_icons[w.icon]; + waypt_add(wpt); + + /* register the point over his internal Humminbird "Number" */ + snprintf(buff, sizeof(buff), "%d", w.num); + avltree_insert(waypoints, buff, wpt); + + } + else if (signature == RTE_MAGIC) { /* here comes a route */ + humminbird_rte_t hrte; + + if (! gbfread(&hrte, 1, sizeof(hrte), fin)) + fatal(MYNAME ": Unexpected end of file!\n"); + + hrte.time = be_read32(&hrte.time); + hrte.num = be_read16(&hrte.num); + + if (hrte.count > 0) { + int i; + route_head *rte = NULL; + + for (i = 0; i < hrte.count; i++) { + waypoint *wpt; + char buff[10]; + hrte.points[i] = be_read16(&hrte.points[i]); + + /* locate the point over his internal Humminbird "Number" */ + snprintf(buff, sizeof(buff), "%d", hrte.points[i]); + if (avltree_find(waypoints, buff, (void *) &wpt)) { + if (rte == NULL) { + rte = route_head_alloc(); + route_add_head(rte); + rte->rte_name = xstrndup(hrte.name, sizeof(hrte.name)); + /* rte->rte_num = hrte.num + 1; only internal number */ + } + route_add_wpt(rte, waypt_dupe(wpt)); + } + } + } + } + else + fatal(MYNAME ": Invalid record header (no or unknown humminbird file)!\n"); - waypt_add(wpt); } } + +/************************************************************************************************/ + static void humminbird_wr_init(const char *fname) { - fout = gbfopen(fname, "w", MYNAME); + fout = gbfopen_be(fname, "wb", MYNAME); + + wptname_sh = mkshort_new_handle(); + + setshort_length(wptname_sh, WPT_NAME_LEN - 1); + setshort_badchars(wptname_sh, BAD_CHARS); + setshort_mustupper(wptname_sh, 0); + setshort_mustuniq(wptname_sh, 0); + setshort_whitespace_ok(wptname_sh, 1); + setshort_repeating_whitespace_ok(wptname_sh, 1); + setshort_defname(wptname_sh, "WPT"); + + rtename_sh = mkshort_new_handle(); + setshort_length(rtename_sh, RTE_NAME_LEN - 1); + setshort_badchars(rtename_sh, BAD_CHARS); + setshort_mustupper(rtename_sh, 0); + setshort_mustuniq(rtename_sh, 0); + setshort_whitespace_ok(rtename_sh, 1); + setshort_repeating_whitespace_ok(rtename_sh, 1); + setshort_defname(rtename_sh, "Route"); + + waypoints = avltree_init(0, MYNAME); + + waypoint_num = 0; + rte_num = 0; } static void humminbird_wr_deinit(void) { + avltree_done(waypoints); + mkshort_del_handle(&wptname_sh); + mkshort_del_handle(&rtename_sh); gbfclose(fout); } @@ -215,64 +312,178 @@ humminbird_write_waypoint(const waypoint *wpt) { double lon, north, east; int i; int num_icons = sizeof(humminbird_icons) / sizeof(humminbird_icons[0]); + char *name; - be_write32(&hum.signature, 0x02020024L); be_write16(&hum.num, waypoint_num++); hum.zero = 0; hum.status = 1; - hum.icon = 0; - + hum.icon = 255; + // Icon.... - if(wpt->icon_descr) { - for(i=0 ; iicon_descr, humminbird_icons[i])) { + if (wpt->icon_descr) { + for (i = 0; i < num_icons; i++) { + if (!case_ignore_strcmp(wpt->icon_descr, humminbird_icons[i])) { hum.icon = i; break; } } + if (hum.icon == 255) { /* no success, no try to find the item in a more comlex name */ + hum.icon = 0; /* i.e. "Diamond" as part of "Diamond, Green" or "Green Diamond" */ + for (i = 0; i < num_icons; i++) { + char *match; + int j; + xasprintf(&match, "*%s*", humminbird_icons[i]); + j = case_ignore_str_match(wpt->icon_descr, match); + xfree(match); + if (j != 0) { + hum.icon = i; + break; + } + } + } } - hum.depth = round(WAYPT_GET(wpt, depth, 0)*100.0); - be_write16(&hum.depth, hum.depth); - + + hum.depth = si_round(WAYPT_GET(wpt, depth, 0)*100.0); + be_write16(&hum.depth, hum.depth); + be_write32(&hum.time, wpt->creation_time); - + east = wpt->longitude / 180.0 * EAST_SCALE; - be_write32(&hum.east, (gbint32)round((east))); + be_write32(&hum.east, si_round((east))); lon = geodetic_to_geocentric_hwr(wpt->latitude); north = inverse_gudermannian_i1924(lon); - be_write32(&hum.north, (gbint32)round(north)); + be_write32(&hum.north, si_round(north)); - strncpy((char *)&hum.name, wpt->shortname, 12); + name = (global_opts.synthesize_shortnames) + ? mkshort_from_wpt(wptname_sh, wpt) + : mkshort(wptname_sh, wpt->shortname); + memset(&hum.name, 0, sizeof(hum.name)); + memcpy(&hum.name, name, strlen(name)); + xfree(name); + + gbfputuint32(WPT_MAGIC, fout); gbfwrite(&hum, sizeof(hum), 1, fout); } +static void +humminbird_rte_head(const route_head *rte) +{ + humrte = NULL; + if (rte->rte_waypt_ct > 0) + humrte = xcalloc(1, sizeof(*humrte)); +} + +static void +humminbird_rte_tail(const route_head *rte) +{ + if (humrte == NULL) return; + + if (humrte->count > 0) { + int i; + char *name; + + humrte->num = rte_num++; + humrte->time = gpsbabel_time; + for (i = 0; i < humrte->count; i++) + be_write16(&humrte->points[i], humrte->points[i]); + + be_write16(&humrte->num, humrte->num); + be_write32(&humrte->time, humrte->time); + + name = mkshort(rtename_sh, rte->rte_name); + strncpy(humrte->name, name, sizeof(humrte->name)); + xfree(name); + + gbfputuint32(RTE_MAGIC, fout); + gbfwrite(humrte, sizeof(*humrte), 1, fout); + } + + xfree(humrte); + humrte = NULL; +} + +static void +humminbird_write_rtept(const waypoint *wpt) +{ + union { + void *p; + int i; + } x; + + if (humrte == NULL) return; + x.p = wpt->extra_data; + if (x.i <= 0) return; + + if (humrte->count < MAX_RTE_POINTS) { + humrte->points[humrte->count] = x.i - 1; + humrte->count++; + } + else { + warning(MYNAME ": Sorry, routes are limited to %d points!\n", MAX_RTE_POINTS); + fatal(MYNAME ": You can use our simplify filter to reduce the number of route points.\n"); + } +} + +static void +humminbird_write_waypoint_wrapper(const waypoint *wpt) +{ + char *key; + waypoint *tmpwpt; + union { /* Pointers as extra_data are 64-bit in a 64-bit world. */ + void *p; /* What we do is to misuse a pointer as an integer, but 'int' is */ + int i; /* (mostly) a 32-bit entity. With this union the compiler keeps quiet! */ + } x = { NULL }; /* Any ideas to a compiler friendly assign of a 32-bit integer to a 64-bit pointer ? */ + + xasprintf(&key, "%s\01%.9f\01\%.9f", wpt->shortname, wpt->latitude, wpt->longitude); + + if (! avltree_find(waypoints, key, (void *)&tmpwpt)) { + tmpwpt = (waypoint *)wpt; + + avltree_insert(waypoints, key, wpt); + + x.i = waypoint_num + 1; /* NOT NULL */ + tmpwpt->extra_data = x.p; + humminbird_write_waypoint(wpt); + } + else { + x.p = tmpwpt->extra_data; + tmpwpt = (waypoint *)wpt; + tmpwpt->extra_data = x.p; + } + + xfree(key); +} + static void humminbird_write(void) { - waypoint_num = 0; - waypt_disp_all(humminbird_write_waypoint); + waypt_disp_all(humminbird_write_waypoint_wrapper); + route_disp_all(NULL, NULL, humminbird_write_waypoint_wrapper); + route_disp_all(humminbird_rte_head, humminbird_rte_tail, humminbird_write_rtept); } /**************************************************************************/ // capabilities below means: we can only read and write waypoints + ff_vecs_t humminbird_vecs = { ff_type_file, { - ff_cap_read | ff_cap_write /* waypoints */, - ff_cap_none /* tracks */, - ff_cap_none /* routes */ + ff_cap_read | ff_cap_write /* waypoints */, + ff_cap_none /* tracks */, + ff_cap_read | ff_cap_write /* routes */ }, - humminbird_rd_init, - humminbird_wr_init, - humminbird_rd_deinit, - humminbird_wr_deinit, + humminbird_rd_init, + humminbird_wr_init, + humminbird_rd_deinit, + humminbird_wr_deinit, humminbird_read, humminbird_write, NULL, // humminbird_exit, humminbird_args, - CET_CHARSET_ASCII, 0 /* ascii is the expected character set */ - /* not fixed, can be changed through command line parameter */ + CET_CHARSET_ASCII, 1 /* ascii is the expected character set */ + /* currently fixed !!! */ }; + /**************************************************************************/ diff --git a/reference/humminbird.hwr b/reference/humminbird.hwr new file mode 100644 index 0000000000000000000000000000000000000000..c5a5db330adee57d1257e76f6a084fe8b9be78fd GIT binary patch literal 864 zcmZQ#Vo+fK0!9Yz9Ue&A2TFZ{|(4Y&B!S#E-5N5hN$6!sj(Gj5EbEPNRhtb zo?o1r1GNq89&VT#%Lfc1yYm^6XYo3grWcp!Iwj@k21Cr@fvK^UVGx<{oFQ3<%PTP> z4{Vd6Aw&%?Tum@gO%YIyhEHZvc3yHuNwK8?L=7KAjdP*i5uh4PhGgxK;F83m5@h%A zL(SP8x)SJSD~8mBDFNC+3XZu7VL91F5OV||YCM*#6Z-$2IrIN}E?a1PA;MV@u7>CT zSuUIZr|#B4(-=aH5J-)9fya_H%NSB$cQDk?&NVOt#;F-noC?FtS=-D|_ClUvg{Opp zIZ%x`k{S`1nsr>DwEBOWb~ZGvBJ2`{tFidMT9EJmJf%I*w2Dw823IrT|16P;{|zaV bq3%Jb5r?T+FZRDv{NexbZ7-ni0jmK31c9wt literal 0 HcmV?d00001 diff --git a/reference/humminbird~hwr.csv b/reference/humminbird~hwr.csv new file mode 100644 index 000000000..7a680b126 --- /dev/null +++ b/reference/humminbird~hwr.csv @@ -0,0 +1,25 @@ +No,Latitude,Longitude,Name,Altitude,Symbol,Depth,Date,Time +1,30.000000,29.999999,"030-030",0.0,"Normal",30.0,2008/08/14,22:03:10 +2,40.000004,40.000001,"040-040",0.0,"Normal",40.0,,00:00:01 +3,50.000003,50.000003,"050-050",0.0,"Normal",50.0,2008/08/14,22:04:32 +4,0.000000,0.000000,"000-000",0.0,"Normal",,2008/08/14,22:04:28 +5,9.999996,10.000002,"010-010",0.0,"Normal",10.0,2008/08/14,22:03:15 +6,19.999999,19.999996,"020-020",0.0,"Normal",20.0,2008/08/14,22:03:13 +7,-19.999999,-19.999996,"020-020-",0.0,"Normal",,2008/08/14,22:13:35 +8,50.877338,12.433892,"B93",0.0,"Normal",,, +9,50.964954,12.435922,"Altnbrg-mgh",0.0,"Normal",,2005/06/24,00:50:24 +10,50.610797,12.173804,"Piehlrstrss",0.0,"Normal",,2005/02/26,08:59:59 +11,50.844124,12.408758,"Gosel",0.0,"Normal",,2005/02/26,09:10:47 +12,50.654766,12.204956,"Augst-Bbl-S",0.0,"Normal",,2005/02/26,08:57:04 +13,50.493663,12.107152,"Jahnstrss11",0.0,"Normal",,2005/02/26,09:02:20 +14,50.493835,12.106101,"Libknchts90",0.0,"Normal",,2005/02/26,09:03:15 +15,50.492620,12.105445,"Start",0.0,"Normal",,2005/11/08,23:03:32 +16,51.314520,12.409144,"P+R Am Vlkr",0.0,"Normal",,2005/06/24,00:36:57 +17,-9.999996,-10.000002,"010-010-",0.0,"Normal",,2008/08/14,22:13:38 +18,-30.000000,-29.999999,"030-030-",0.0,"Normal",,2008/08/14,22:13:32 +19,60.000002,59.999997,"060-060",0.0,"Normal",60.0,2008/08/14,22:07:34 +20,69.999999,70.000000,"070-070",0.0,"Normal",,2008/08/14,22:11:15 +21,-40.000004,40.000001,"040-040-",0.0,"Normal",,2008/08/14,22:13:30 +22,-50.000003,-50.000003,"050-050-",0.0,"Normal",,2008/08/14,22:14:16 +23,-60.000002,-59.999997,"060-060-",0.0,"Normal",,2008/08/14,22:15:44 +24,-69.999999,-70.000000,"070-070-",0.0,"Normal",,2008/08/14,22:17:58 diff --git a/reference/route/humminbird.hwr b/reference/route/humminbird.hwr new file mode 100644 index 0000000000000000000000000000000000000000..aad451e5ee42dd52ce7b52c3d000d971d51744e9 GIT binary patch literal 3504 zcmb`JS!`5Q7{|Y^fXY@V7TH=vDBJWdbIzTiY*S|1X?r_oItx&wktN0@F%$!Wh6kfy z^+AnwmJyyR{H(9*f3-4ft{~Ar#0<{m_wuQh3;@ZrH|?xchK(CwPJ?k25HQs~bN%(6 z%CPk`n8%or)a}$neYO2TqO_NpaZ9sP8~7TmhA&29>mFt@-A-M|)KrFJCrRuWWtJ7! z?9^+_TOSLt{P!(;^vWc-|BD#Pq$5@MVi%=R+q+i41!s>(3$gq{&TdA{ar z%my&m!RUQ>m&V+JuX=7cezkmG3qpqA>rE25RbX^I3quBaoP&t{Ic_BMK3o(qGSBhP z5&K?l+J1-mz7_|JoYVM=U@n5u^(+Y)nV+{Y@4s+!Qhu7F4F4KToST#4Y6+RCi0cjP zgm=N{bziD6Ka$us1B{--y8}kX#Zj+;8{BgA{ez9@?Ycpk!`)#1{ugsk$Vfe}U@peM z=yS2$XVgA)V%Q1aax08e65V?aRl`2=T=gWeO1U{ zzU)&Z_SACQ(lxIRnJK6j=4+SW_M~06CS+iTwPH?BfpIK9i)xnFYRrBx?@K0#Ofj*L zfiFHp;=XZiPwLgSkU=e2BZ>A6oZEV@BBPOdeL$k`3{N_Ge$bVQQMKR;NVpexa#DVv z-?t<6l%YA+kx3Prv)!&6>?l;mV~nrBBw*)UN5*wCTO+##>LlasI{P8aavr-y?^PDq z8IdHjz8=|!2IlmtWGsKPDh53=!6Y`Ke|}Yr zKN*VY^cb%XIr8IvEE%+(dKA;;+fnxxb`;Dt$pp=+m~7z7I14@Rp`X9Onc}#jOSYI- z_wJ~jwo%l56!*GBE|tsVkvnClC$KXp?>3i_!<@Xgh>l_@g}f-HH);oWJ|ULpQ@K*M zuqCxMmh&;Y zFj)|hen#*6d6ss%z%E`(o2HRVGiW;X&`g>|v#EiKw2IcyT8fcHt+bL>&~jQzEwqH1X)!ILd9c(7 zi(O<_@QjY7JsmP&$j*-JI8@ko@WB24IitRnze-d-`amzO`yoy89VvX|i4%0@yR%fa z`K2R6b;pljt5qJs=Yh*I+b85(ba<$Tn!Z1)e%9mfYd0Gpp6HWX4fN?xX)@Y-@K!{J ajM3Baq|$-2KzrJW{g;mO&{6$A>G%g`40`VX literal 0 HcmV?d00001 diff --git a/reference/route/humminbird~hwr.gpx b/reference/route/humminbird~hwr.gpx new file mode 100644 index 000000000..c73ecd8ca --- /dev/null +++ b/reference/route/humminbird~hwr.gpx @@ -0,0 +1,1106 @@ + + + + + + 0.000000 + + 5066 + 5066 + 5066 + Normal + + + 0.000000 + + 5067 + 5067 + 5067 + Normal + + + 0.000000 + + 5096 + 5096 + 5096 + Normal + + + 0.000000 + + 5142 + 5142 + 5142 + Normal + + + 0.000000 + + 5156 + 5156 + 5156 + Normal + + + 0.000000 + + 5224 + 5224 + 5224 + Normal + + + 0.000000 + + 5229 + 5229 + 5229 + Normal + + + 0.000000 + + 5237 + 5237 + 5237 + Normal + + + 0.000000 + + 5254 + 5254 + 5254 + Normal + + + 0.000000 + + 5258 + 5258 + 5258 + Normal + + + 0.000000 + + 5264 + 5264 + 5264 + Normal + + + 0.000000 + + 526708 + 526708 + 526708 + Normal + + + 0.000000 + + 526750 + 526750 + 526750 + Normal + + + 0.000000 + + 527614 + 527614 + 527614 + Normal + + + 0.000000 + + 527631 + 527631 + 527631 + Normal + + + 0.000000 + + 5278 + 5278 + 5278 + Normal + + + 0.000000 + + 5289 + 5289 + 5289 + Normal + + + 0.000000 + + 5374FIRE + 5374FIRE + 5374FIRE + Normal + + + 0.000000 + + 5376 + 5376 + 5376 + Normal + + + 0.000000 + + 6006 + 6006 + 6006 + Normal + + + 0.000000 + + 6006BLUE + 6006BLUE + 6006BLUE + Normal + + + 0.000000 + + 6014MEADOW + 6014MEADOW + 6014MEADOW + Normal + + + 0.000000 + + 6029 + 6029 + 6029 + Normal + + + 0.000000 + + 6053 + 6053 + 6053 + Normal + + + 0.000000 + + 6066 + 6066 + 6066 + Normal + + + 0.000000 + + 6067 + 6067 + 6067 + Normal + + + 0.000000 + + 6071 + 6071 + 6071 + Normal + + + 0.000000 + + 6073 + 6073 + 6073 + Normal + + + 0.000000 + + 6084 + 6084 + 6084 + Normal + + + 0.000000 + + 6130 + 6130 + 6130 + Normal + + + 0.000000 + + 6131 + 6131 + 6131 + Normal + + + 0.000000 + + 6153 + 6153 + 6153 + Normal + + + 0.000000 + + 6171 + 6171 + 6171 + Normal + + + 0.000000 + + 6176 + 6176 + 6176 + Normal + + + 0.000000 + + 6177 + 6177 + 6177 + Normal + + + 0.000000 + + 6272 + 6272 + 6272 + Normal + + + 0.000000 + + 6272 + 6272 + 6272 + Normal + + + 0.000000 + + 6278 + 6278 + 6278 + Normal + + + 0.000000 + + 6280 + 6280 + 6280 + Normal + + + 0.000000 + + 6283 + 6283 + 6283 + Normal + + + 0.000000 + + 6289 + 6289 + 6289 + Normal + + + 0.000000 + + 6297 + 6297 + 6297 + Normal + + + 0.000000 + + 6328 + 6328 + 6328 + Normal + + + 0.000000 + + 6354 + 6354 + 6354 + Normal + + + 0.000000 + + 635722 + 635722 + 635722 + Normal + + + 0.000000 + + 635783 + 635783 + 635783 + Normal + + + 0.000000 + + 6373 + 6373 + 6373 + Normal + + + 0.000000 + + 6634 + 6634 + 6634 + Normal + + + 0.000000 + + 6979 + 6979 + 6979 + Normal + + + 0.000000 + + 6997 + 6997 + 6997 + Normal + + + 0.000000 + + BEAR HILL + BEAR HILL + BEAR HILL + Normal + + + 0.000000 + + BELLEVUE + BELLEVUE + BELLEVUE + Normal + + + 0.000000 + + 6016 + 6016 + 6016 + Normal + + + 0.000000 + + 5236BRIDGE + 5236BRIDGE + 5236BRIDGE + Normal + + + 0.000000 + + 5376BRIDGE + 5376BRIDGE + 5376BRIDGE + Normal + + + 0.000000 + + 6181CROSS + 6181CROSS + 6181CROSS + Normal + + + 0.000000 + + 6042CROSS + 6042CROSS + 6042CROSS + Normal + + + 0.000000 + DARKHOLLPO + DARKHOLLPO + DARKHOLLPO + Fish + + + 0.000000 + + 6121DEAD + 6121DEAD + 6121DEAD + Danger + + + 0.000000 + + 5179DEAD + 5179DEAD + 5179DEAD + Danger + + + 0.000000 + + 5299DEAD + 5299DEAD + 5299DEAD + Danger + + + 0.000000 + + 5376DEAD + 5376DEAD + 5376DEAD + Danger + + + 0.000000 + + 6353DEAD + 6353DEAD + 6353DEAD + Danger + + + 0.000000 + + 6155DEAD + 6155DEAD + 6155DEAD + Danger + + + 0.000000 + + GATE14 + GATE14 + GATE14 + Normal + + + 0.000000 + + GATE16 + GATE16 + GATE16 + Normal + + + 0.000000 + + GATE17 + GATE17 + GATE17 + Normal + + + 0.000000 + + GATE19 + GATE19 + GATE19 + Normal + + + 0.000000 + + GATE21 + GATE21 + GATE21 + Normal + + + 0.000000 + + GATE24 + GATE24 + GATE24 + Normal + + + 0.000000 + + GATE5 + GATE5 + GATE5 + Normal + + + 0.000000 + + GATE6 + GATE6 + GATE6 + Normal + + + 0.000000 + + 6077LOGS + 6077LOGS + 6077LOGS + Normal + + + 0.000000 + + 5148NANEPA + 5148NANEPA + 5148NANEPA + Normal + + + 0.000000 + + 5267OBSTAC + 5267OBSTAC + 5267OBSTAC + Normal + + + 0.000000 + + PANTHRCAVE + PANTHRCAVE + PANTHRCAVE + Normal + + + 0.000000 + + 5252PURPLE + 5252PURPLE + 5252PURPLE + Normal + + + 0.000000 + + 5287WATER + 5287WATER + 5287WATER + Normal + + + 0.000000 + + 5239ROAD + 5239ROAD + 5239ROAD + Normal + + + 0.000000 + + 5278ROAD + 5278ROAD + 5278ROAD + Normal + + + 0.000000 + + 5058ROAD + 5058ROAD + 5058ROAD + Normal + + + 0.000000 + + SHEEPFOLD + SHEEPFOLD + SHEEPFOLD + Normal + + + 0.000000 + + SOAPBOX + SOAPBOX + SOAPBOX + Normal + + + 0.000000 + + 5376STREAM + 5376STREAM + 5376STREAM + Normal + + + 0.000000 + + 5144SUMMIT + 5144SUMMIT + 5144SUMMIT + Normal + + + 0.000000 + + 5150TANK + 5150TANK + 5150TANK + Normal + + + BELLEVUE + + 0.000000 + + BELLEVUE + BELLEVUE + BELLEVUE + Normal + + + 0.000000 + + GATE6 + GATE6 + GATE6 + Normal + + + 0.000000 + + PANTHRCAVE + PANTHRCAVE + PANTHRCAVE + Normal + + + 0.000000 + + 6014MEADOW + 6014MEADOW + 6014MEADOW + Normal + + + 0.000000 + + 6006 + 6006 + 6006 + Normal + + + 0.000000 + + 6006BLUE + 6006BLUE + 6006BLUE + Normal + + + 0.000000 + + 5096 + 5096 + 5096 + Normal + + + 0.000000 + + 5066 + 5066 + 5066 + Normal + + + 0.000000 + + 5067 + 5067 + 5067 + Normal + + + 0.000000 + + 5058ROAD + 5058ROAD + 5058ROAD + Normal + + + 0.000000 + + 5150TANK + 5150TANK + 5150TANK + Normal + + + 0.000000 + + 5142 + 5142 + 5142 + Normal + + + 0.000000 + + 5144SUMMIT + 5144SUMMIT + 5144SUMMIT + Normal + + + 0.000000 + + 5156 + 5156 + 5156 + Normal + + + 0.000000 + + 5148NANEPA + 5148NANEPA + 5148NANEPA + Normal + + + 0.000000 + + 5258 + 5258 + 5258 + Normal + + + 0.000000 + + 5252PURPLE + 5252PURPLE + 5252PURPLE + Normal + + + 0.000000 + + 527631 + 527631 + 527631 + Normal + + + 0.000000 + + 527614 + 527614 + 527614 + Normal + + + 0.000000 + + 5267OBSTAC + 5267OBSTAC + 5267OBSTAC + Normal + + + 0.000000 + + 5278 + 5278 + 5278 + Normal + + + 0.000000 + + 5289 + 5289 + 5289 + Normal + + + 0.000000 + + 5374FIRE + 5374FIRE + 5374FIRE + Normal + + + 0.000000 + + 5376 + 5376 + 5376 + Normal + + + 0.000000 + + 5376STREAM + 5376STREAM + 5376STREAM + Normal + + + 0.000000 + + 6328 + 6328 + 6328 + Normal + + + 0.000000 + + 635722 + 635722 + 635722 + Normal + + + 0.000000 + + 635783 + 635783 + 635783 + Normal + + + 0.000000 + + 6373 + 6373 + 6373 + Normal + + + 0.000000 + + BEAR HILL + BEAR HILL + BEAR HILL + Normal + + + 0.000000 + + 6289 + 6289 + 6289 + Normal + + + 0.000000 + + 6297 + 6297 + 6297 + Normal + + + 0.000000 + + 6283 + 6283 + 6283 + Normal + + + 0.000000 + + 6280 + 6280 + 6280 + Normal + + + 0.000000 + + 6177 + 6177 + 6177 + Normal + + + 0.000000 + + 6176 + 6176 + 6176 + Normal + + + 0.000000 + + 6153 + 6153 + 6153 + Normal + + + 0.000000 + + 6171 + 6171 + 6171 + Normal + + + 0.000000 + + 6131 + 6131 + 6131 + Normal + + + 0.000000 + + 6130 + 6130 + 6130 + Normal + + + 0.000000 + + 6029 + 6029 + 6029 + Normal + + + 0.000000 + + 6006 + 6006 + 6006 + Normal + + + 0.000000 + + 6014MEADOW + 6014MEADOW + 6014MEADOW + Normal + + + 0.000000 + + PANTHRCAVE + PANTHRCAVE + PANTHRCAVE + Normal + + + 0.000000 + + GATE6 + GATE6 + GATE6 + Normal + + + 0.000000 + + BELLEVUE + BELLEVUE + BELLEVUE + Normal + + + + Route2 + + 0.000000 + + 5144SUMMIT + 5144SUMMIT + 5144SUMMIT + Normal + + + 0.000000 + + 5150TANK + 5150TANK + 5150TANK + Normal + + + + Route3 + + 0.000000 + + 5179DEAD + 5179DEAD + 5179DEAD + Danger + + + 0.000000 + + 5236BRIDGE + 5236BRIDGE + 5236BRIDGE + Normal + + + diff --git a/testo b/testo index a11c959bf..84d5da61a 100755 --- a/testo +++ b/testo @@ -1395,5 +1395,15 @@ compare ${TMPDIR}/height_out.gpx ${REFERENCE}/track/height_out.gpx ${PNAME} -i iblue747 -f ${REFERENCE}/track/iblue747.csv -o gpx -F ${TMPDIR}/iblue747~csv.gpx compare ${REFERENCE}/track/iblue747~csv.gpx ${TMPDIR}/iblue747~csv.gpx +# +# Humminbird waypoints/routes +# +${PNAME} -i humminbird -f ${REFERENCE}/humminbird.hwr -o unicsv,utc=0 -F ${TMPDIR}/humminbird~hwr.csv +compare ${REFERENCE}/humminbird~hwr.csv ${TMPDIR}/humminbird~hwr.csv +${PNAME} -i humminbird -f ${REFERENCE}/humminbird.hwr -o humminbird -F ${TMPDIR}/humminbird.hwr +bincompare ${REFERENCE}/humminbird.hwr ${TMPDIR}/humminbird.hwr +${PNAME} -i humminbird -f ${REFERENCE}/route/humminbird.hwr -o gpx -F ${TMPDIR}/humminbird~hwr.gpx +compare ${REFERENCE}/route/humminbird~hwr.gpx ${TMPDIR}/humminbird~hwr.gpx + exit 0 diff --git a/vecs.c b/vecs.c index 31a28e9e0..6fb8fbbc0 100644 --- a/vecs.c +++ b/vecs.c @@ -807,7 +807,7 @@ vecs_t vec_list[] = { { &humminbird_vecs, "humminbird", - "Humminbird waypoints (.hwr)", + "Humminbird waypoints and routes (.hwr)", "hwr" }, { diff --git a/xmldoc/formats/humminbird.xml b/xmldoc/formats/humminbird.xml index b61f21ce2..ccdd7b0e9 100644 --- a/xmldoc/formats/humminbird.xml +++ b/xmldoc/formats/humminbird.xml @@ -1,5 +1,5 @@ - This format supports Humminbird waypoints (.hwr files). + This format supports Humminbird waypoints and routes (.hwr files). If you do "save all nav data" on the device, you'll get a @@ -15,9 +15,11 @@ Known limits: - max 12 characters for waypoint names. - Only does waypoints. Tracks are in a different file + Only does waypoints and routes. Tracks are in a different file (like 000.ht). + max 12 characters for waypoint names. + max 20 characters for route names. + max 50 points per route. Use simplify filter (count=50 or less) if you have routes with more points! -- 2.30.2